package com.niodata.dp.monitor.core.task;

import com.niodata.dp.monitor.core.task.az.FlowExecutionDetail;
import com.niodata.dp.monitor.core.task.entity.FlowExecutionHistory;
import com.niodata.dp.monitor.core.task.entity.TaskInfo;
import com.niodata.dp.monitor.sharelib.entity.az.FlowExecutor;
import com.niodata.dp.monitor.sharelib.entity.task.TaskExecution;
import java.io.IOException;
import java.util.Date;
import java.util.List;
import java.util.Map;


public interface TaskExecutionManager {

  public TaskInfo getTaskByName(String taskName);

  public List<TaskInfo> getAllTasks();

  public List<FlowExecutionHistory> getExecutionHistory(int offset, int count);

  public FlowExecutionDetail getTaskExecutionDetail(int execid);

  public List<FlowExecutionHistory> getRecentlyFinished();

  public List<TaskExecution> getAllRunningExecutions();

  public List<FlowExecutor> getFlowExecutors() throws IOException;

  public List<TaskExecution> getPreparingExecutions();

  public void checkExecutionStatusInMemory();

  public void updateExecutionStatus(int execId, String status, Date startTime, Date endTime);

  public void checkExecutionStatusInDb();

  public void syncExecutionList();

  public Map<String, String> getTimeOutMap(String taskName);

  public void putToTimeOutMap(String taskName, Map<String, String> execMap);

  public void removeTimeOutMap(String taskName);

  public void addExpectList();

  public void checkNotFound();

}
